package Utils;

import javax.swing.*;

/**
 * The type Validate.
 *
 * @author dzr
 * @version 1.0
 */
public class Validate {
    /**
     * Whether the textField is empty.
     *
     * @param jTextField the jtextField
     * @return the result
     */
    public static boolean isEmpty(JTextField jTextField){
        return jTextField.getText().trim().isEmpty();
    }

    /**
     * Whether the textField's content is digital.
     *
     * @param jTextField the jtextField
     * @return the result
     */
    public static boolean isDigital(JTextField jTextField){
        String pattern = "\\d+";
        return jTextField.getText().matches(pattern);
    }
}
